import { createWebHistory, createRouter } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/overview',
    component: () => import('../views/IndexView.vue'),
    children: [
      {
        path: 'overview',
        component: () => import('../views/OverView.vue')
      },
      {
        path: 'localfile',
        component: () => import('../views/FileView.vue')
      },
      {
        path: 'article',
        component: () => import('../views/ArticleView.vue')
      },
      {
        path: 'gallery',
        component: () => import('../views/GalleryView.vue')
      },
      {
        path: 'diary',
        component: () => import('../views/DiaryView.vue')
      },
      {
        path: 'source',
        component: () => import('../views/SourceView.vue')
      }
    ]
  },
  {
    path: '/addarticle',
    component: () => import('../views/AddArticle.vue')
  },
  {
    path: '/addGallery',
    component: () => import('../views/AddGallery.vue')
  },
  {
    path: '/addDiary',
    redirect: '/diary',
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router